package com.example.mapper;

import com.example.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /**
     * 根据username查询
     */
    @Select("select * from housekeeper.users where username = #{username};")
    User getByUsername(String username);

    @Insert("insert into housekeeper.users (username, password) values (#{username},#{password});")
    void insert(User user);
}
